<?php include_once 'head.php' ?>
<div class="text">
    <div class="write">
        <div>
            <!--<form action="save.php" method="post" name="write" onsubmit="return verify(this)">-->
            <p>注：
            <spwn style="color:#F00;">*</spwn>
            项目为必填<br/>
            </p>

            <div class="form-group">
                <label for="exampleInputName2">昵称</label>
                <input type="text" class="form-control" id="nick" placeholder="昵称">
            </div>

            <div class="form-group">
                <label for="exampleInputEmail1">邮箱</label>
                <input type="email" class="form-control" id="email" placeholder="对方邮箱">
            </div>

<!--<p>对方邮箱:<input type="text" name="email"/> # 可选，如果填写，则向Ta的邮箱发送一封邮件通知^_^</p>-->

            <p>亲，你想对Ta说点什么呢<br/>
                <input type="text" class="form-control" id="txt" placeholder="Text input">
            </p>
            <p><input type="submit" id="sub" value="提交匿名表白"/></p>
            <!--</form>-->
        </div>
        <br/>
        <br/>
    </div>
</div>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="<?= $viewUrl ?>/js/jquery-2.1.4.min.js" ></script>
<script>
    $(document).ready(function () {
        $("#sub").click(function () {
            var nick = $("#nick").val();
            var email = $("#email").val();
            var txt = $("#txt").val();

            $.ajax({
                type: "POST",
                url: "<?=$BaseUrl?>/lib/writeMsg.php",
                dataType: "json",
                data: {
                    nick: nick,
                    email: email,
                    context: txt
                },
                success: function (data) {

                },
                error: function (jqXHR) {

                }
            });
        });
    });
</script>

<?php
require_once 'foot.php';
